import http from '../../utils/httpRequest'

export default {
  getPurchaseList (currentPage, size,id,assigneeName,status) {
    return http({
      url: `/wms/purchase/searchPurchaseMenu/${currentPage}/${size}`,
      method: 'post',
      data:{
        id,
        assigneeName,  // 采购人的名字
        status // 采购单状态 小于等于以下的状态 lessAndEquals [0新建，1已分配，2正在采购，3已完成，4采购失败]
      }
    })
  },


  // 为当前的采购需求创建一个新的采购单，并将采购需求合并到这个新的采购单中
  /**
   * [
       {
        "id": 0,
        "purchaseId": 0,
        "skuId": 0,
        "skuNum": 0,
        "skuPrice": 0,
        "status": 0,
        "wareId": 0
      }
   ]
   * */
  createPurchasingMenuAndMergeToIt(data){
    return http({
      url:`/wms/purchase/createPurchasingMenuAndMergeToIt`,
      method:'post',
      data:data
    });
  },

  /**
   *
   将purchaseDetail采购需求绑定到采购表上
   * */
  bindPurchaseDetailToPurchaseId(purchaseDetailList){
    return http({
      url:`/wms/purchase/bindPurchaseDetailToPurchaseId`,
      method:'post',
      data: purchaseDetailList
    });
  }
}
